package com.wufun.overseas.models.db;

import com.j256.ormlite.field.DatabaseField;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by caowd on 2015/6/11.
 */
@Entity
public class HandShankTable {

    /**
     * 手柄地址
     */
    @DatabaseField(id = true)
    private String address;


    /**
     * 手柄名
     */
    @DatabaseField
    private String name;


    /**
     * 连接时间
     */
    @DatabaseField
    private Long time;

    private Boolean isConnect = false;

    @Generated(hash = 836823800)
    public HandShankTable(String address, String name, Long time, Boolean isConnect) {
        this.address = address;
        this.name = name;
        this.time = time;
        this.isConnect = isConnect;
    }

    @Generated(hash = 1525270198)
    public HandShankTable() {
    }

    public Boolean getIsConnect() {
        return isConnect;
    }

    public void setIsConnect(Boolean isConnect) {
        this.isConnect = isConnect;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {

        if(o instanceof  HandShankTable){
            HandShankTable handShankTable = (HandShankTable) o;
            return ((HandShankTable) o).getAddress().equals(this.getAddress());
        }
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return this.getAddress().hashCode();
    }
}
